﻿<div class="agent">
    <div class="title mt20">
        <div class="clearfix">
            <h2>宾果代理官</h2>
            <a href="javascript:void(0)">more</a>
        </div>
    </div>
    <div class="agent-main mt10">
        <div class="wrap scrollView" id="scrollView">
            <ul class="scrollV-wrap" id="scrollV-wrap1">
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 860.00</span>
                    <p>李文博</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 1200.00</span>
                    <p>胡志广</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 700.00</span>
                    <p>林子威</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 1080.00</span>
                    <p>李川</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 680.00</span>
                    <p>张亮</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 1100.00</span>
                    <p>邓国安</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 800.00</span>
                    <p>王建</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 650.00</span>
                    <p>胡天雨</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 1120.00</span>
                    <p>张家硕</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 980.00</span>
                    <p>高宇辰</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 1000.00</span>
                    <p>谢依娜</p>
                    <p>1月前入驻</p>
                </li>
                <li>
                    <span>累计获得奖励</span><span class="main-color">¥ 920.00</span>
                    <p>于焱</p>
                    <p>1月前入驻</p>
                </li>
            </ul>
            <ul id="scrollV-wrap2"></ul>
        </div>
        <div class="agent-protocol">
            <a href="javascript:void(0)" id="releaseNow">立即发布活动</a>
        </div>
    </div>
</div>
<script type="text/javascript">


    $("#releaseNow").on("click",function(){
        var userTypeNow = GetUserTypeNow();
        CheckUserNow(userTypeNow);
    });
    
    function CheckUserNow(userTypeNow) {
        if (common.checkValue(userTypeNow) != "" && common.checkValue(userTypeNow)) {
            HeaderReleseProject();
        }
    }

    function GetUserTypeNow() {
        var user = common.GetStorageSession("user");

        if (!common.checkValue(user)) {
             common.showMessage("请先登录再发布活动",function(){
                window.location = "/login.html";
             })
            return;
        }

        var obj = $.parseJSON(user);
        return obj.UserType;
    }
    

    function HeaderReleseProject() {
        common.commonAjax({ type: 'Get', url: '/api/user/HasVerified', sMethod: AfterHeaderVerified });
    }
    function AfterHeaderVerified(ctx) {
        if (ctx == null) {
            common.alertMessage("无数据.");
            return;
        }

        if (ctx.ResponseDict.HasVerified == "Y") {
            window.location = "/release.html";
        }
        else {
            common.showMessage(ctx.ResponseDict.Message, function () {
            })
        }
    }
</script>
